package com.project.weimi.widget;

import com.project.weimi.R;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

/**
 * @ClassName: CustomBar 
 * @Description: TODO 全局Title
 * @author admin
 */
public class CustomBar extends RelativeLayout{

	private ImageView left_bar;
	private TextView middle_bar;
	private TextView right_bar;
	
	
	public CustomBar(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public CustomBar(Context context) {
		super(context);
	}

	public void initBar(ViewGroup root){
		left_bar = (ImageView)root.findViewById(R.id.left_bar);
		middle_bar = (TextView)root.findViewById(R.id.middle_bar);
		right_bar = (TextView)root.findViewById(R.id.right_bar);
	}
	
	// 设置标题栏文字
	public void setTitleBar(String title){
		middle_bar.setText(title);
	}
	
	public ImageView getLeftBar(){
		return left_bar;
	}
	
//	public void setRightBar(String right){
//		right_bar.setVisibility(View.VISIBLE);
//		right_bar.setText(right);
//	}
	
	public TextView getRightBar(){
		return right_bar;
	}
	
}
